//
//  BHStadiumOrderInfoHeaderCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/7/6.
//

import UIKit

class BHStadiumOrderInfoHeaderCell: UITableViewCell {

    @IBOutlet weak var state_label: UILabel!
    
    @IBOutlet weak var price_label: UILabel!
    
    @IBOutlet weak var card_backView: UIImageView!
    
    @IBOutlet weak var text_label: UILabel!
    
    @IBOutlet weak var card_no_label: UILabel!
    
    @IBOutlet weak var line: UILabel!
    
    
    var model: BHUserOrderDetailModel! {
        didSet {
            if model.orderId.isEmpty == true {
                return
            }
            
            if model.status == 1 {
                self.state_label.text = "待使用"
            }else if model.status == 2 {
                self.state_label.text = "已完成"
            }else if model.status == 3 {
                self.state_label.text = "退款"
            }else {
                self.state_label.text = ""
            }
           
            self.card_backView.isHighlighted = model.status != 1
            self.text_label.isHighlighted = model.status != 1
            self.card_no_label.isHighlighted = model.status != 1
            self.line.isHidden = model.status == 1
            self.card_no_label.text = model.evidence
            self.price_label.text = "¥\(model.payPrice)"
        }
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    static var cellHeight: CGFloat {
        get {
            return CGFloat(140)+83
        }
    }
    
}
